extensions: fast-float: babl_lookup(): use 1UL, not just 1
authorRoman Lebedev <lebedev.ri@gmail.com>
Fri, 19 Aug 2016 17:04:59 +0000 (20:04 +0300)
committerØyvind Kolås <pippin@gimp.org>
Sat, 20 Aug 2016 17:36:37 +0000 (19:36 +0200)
Fixes:

fast-float.c:81:35: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
and
fast-float.c:91:34: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

extensions/fast-float.c

index fd7fb9fdae483b5855e291aac559c7a22938362b..04802a9c3ac466f08a80ecd35e824d32a1e3607c 100644 (file)
@@ -78,7 +78,7 @@ babl_lookup (BablLookup *lookup,
   else
     return lookup->function (number, lookup->data);
 
-  if (!(lookup->bitmask[i/32] & (1<<(i & 31))))
+  if (!(lookup->bitmask[i/32] & (1UL<<(i & 31))))
     {
       /* XXX: should look up the value in the middle of the range
        *      that yields a given value,
@@ -88,7 +88,7 @@ babl_lookup (BablLookup *lookup,
        *      lookup table.. 
        */
       lookup->table[i]= lookup->function (number, lookup->data);
-      lookup->bitmask[i/32] |= (1<<(i & 31));
+      lookup->bitmask[i/32] |= (1UL<<(i & 31));
     }
 
   return lookup->table[i];